
<template>
  <div class="pay">

    <div class="pay dd-column dd-h-center">
      <div class="confirm">确认支付</div>
      <div class="money">￥{{orderWaitPay.totalMoney}}</div>
      <div style='font-size:10pt;margin-top:15pt;'>剩余支付时间 {{payData.hour}}:{{payData.minute}}:{{payData.second}}</div>
      <div class='dd-column dd-center' style='margin-top:60pt;'>
        <div class="dd-btn-yellow-c" @click='wxPay'>微信支付</div>
        <div class="dd-btn-red-c" style="margin-top:20pt;">支付宝</div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
export default {
  commit: {},
  computed: {
    ...mapState({
      orderWaitPay: state => {
        return state.goods.orderWaitPay;
      }
    })
  },
  data() {
    return {
      // orderWaitPay,
      payData: {
        // forThePayment: 0,
        hour: "00",
        minute: "00",
        second: "00",
        msg: ">支付失败<"
      }
    };
  },
  mounted() {
    console.log("-mounted中-----", this.orderWaitPay);
  },
  methods: {
    //  支付之后
    wxPay() {
      // 支付

      // 支付成功 改变此订单状态为 2 已支付 存放在服务器 待取货

      this.orderWaitPay.status = 2;//改变后的状态
      this.orderWaitPay.pickUpCode = 125616; // 得到的取货码

      let _obj = this.orderWaitPay
      console.log("this.orderWaitPay", _obj);

      this.$store.commit("makeOrderDetails", _obj);

      this.$router.push("/my/myOrder/myOrderDetails");
    }
  }
};
</script>
<style scoped>
/* 确认 */
.confirm {
  font-size: 10pt;
  margin-top: 20pt;
}
/* 钱数 */
.money {
  font-size: 28px;
  margin-top: 15pt;
}
</style>
